// 引入数据库
const conn = require('../../data/index');

//#region 注册页面的初始化
module.exports.BEregister=(req,res)=>{
    res.render('background/register');
}
//#endregion 

//#region 注册页面的注册功能
module.exports.BEregisterFunction=(req,res)=>{
    console.log(req.body);
    conn.query('insert into bg_users (email,password) values(?,?)',[req.body.email,req.body.password],(error,data)=>{
        if(error) return console.log(error);
        res.json({
            code:'1101',
            msg:'注册成功'
        })
    })
}
//#endregion 

